<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>父组件向子组件传递数据——依赖注入的引入</title>
</head>
<body>
<div id="app">
    <parent v-bind:information="info"></parent>
</div>

<template id="child">
    <h1>Hello, World!</h1>
        <h2>{{ info }}</h2>
</template>

<template id="parent">
    <!--   <div>{{ information }}</div>-->
    <child v-bind:info="information"></child>
</template>

<script type="module">
    import {createApp, ref} from "../../../../js/vue.esm-browser.js";
    import {defineComponent} from "../../../../js/vue.esm-browser.js";


    let child = defineComponent(
        {
            template: "#child",
            props:["info"],
        }
    );

    let parent = defineComponent(
        {
            template: "#parent",
            props: ["information"],

            setup(props) {
                console.log(props);
                // let in = props.information

                let {information} = props

                console.info(information)
                return {
                    information,
                };
            },

            components: {
                child,
            }
        }
    );
    let app = createApp(
        {
            setup() {
                let info = ref("Hello, Vue!")
                return {
                    info,
                }
            },
            components: {
                parent,
            }
        }
    )
    app.mount("#app")
</script>
</body>
</html>